# def func(name):
#     print('---->',name)
#
# username = '张三'
# func(username)

# def func(names):
#     for name in names:
#         print('---->',name)
#
# name_list = ['张三','李四','王五']
# func(name_list)
#
# class Phone:
#     # 魔术方法之一：__init__
#     def __init__(self):
#         print('---->init')
#
#     def call(self):
#         print('---->call')
#         print('价格:',self.price) #不能保证每个self中都存在price
#
# p = Phone()
# p.price = 10000
# p.call()
#
# p1 = Phone()
# p1.call()
print('----------------------------------')
class Phone:
    name = '张三'

    def __init__(self, name,age):
        self.name = 'zhangsan'
        self.age = 18

    def eat(self,food):
        print('{}正在吃{}！。。。'.format(self.name,food))

    def run(self):
        print('{},今年{}岁,正在跑步！。。。'.format(self.name,self.age))

p = Phone('李四',18)
p.name = '李四'
p.eat('苹果')

p1 = Phone('王五',19)
p1.name  = '王五'
p1.eat('香蕉')
p1.run()





